package com.chinackts.proceedspayment.importpayment.controller;

import com.alibaba.fastjson.JSONObject;
import com.chinackts.proceedspayment.importpayment.dto.ImportPaymentListDto;
import com.chinackts.proceedspayment.importpayment.query.ImportPaymentPageQuery;
import com.chinackts.proceedspayment.importpayment.query.ImportPaymentQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * @author Lianhong
 * @since 2021/11/18
 */
@Api(tags = "进口付汇")
public interface ImportPaymentControllerInterface {

    @ApiOperation("查询进口付汇列表")
    @GetMapping("/{id}/import-payment")
    ResponseEntity<ImportPaymentListDto> list(@PathVariable String id, @Valid ImportPaymentQuery query);

    @ApiOperation("查询进口付汇列表（分页）")
    @GetMapping("/{id}/import-payment/paging")
    ResponseEntity<ImportPaymentListDto> pageList(@PathVariable String id, @Valid ImportPaymentPageQuery query);

    @ApiOperation("查询进口付汇明细")
    @GetMapping("/{id}/import-payment/{entryId}")
    ResponseEntity<JSONObject> details(@PathVariable String id, @PathVariable String entryId, @RequestParam(required = false) boolean regather);

    @ApiOperation("进口付汇PDF下载")
    @PostMapping("/{id}/import-payment/pdf")
    ResponseEntity<Void> importPaymentPdf(@PathVariable String id, @RequestBody List<String> entryIds, HttpServletResponse response);

}
